<?php
class Modules
{
    function __get($moduleName)
    {
        include_once(ROOT . "/modules/Base.class.php");
        if (!file_exists(ROOT . "/modules/" . $moduleName . ".class.php")) throw new ErrorException("the Module " . $moduleName . "is error");
        include_once(ROOT . "/modules/" . $moduleName . ".class.php");
        if (Register::getObject("module_" . $moduleName) == null) {
            Register::setObject("module_" . $moduleName, new $moduleName);
        }
        return Register::getObject("module_" . $moduleName);
    }
}

?>